package org.fastsyncer.common.entity;

import java.io.Serializable;
import java.util.Date;

import org.fastsyncer.common.constant.MappingConstant;

/**
 * 默认的驱动配置
 * 
 * @ClassName: Task
 * @Description: 包含基本的映射名称、同步状态（全量、增量）、线程数、同步时间等
 * @author AE86
 * @date: 2017年7月12日 下午1:57:43
 */
public class Task implements Serializable {

    private static final long serialVersionUID = 323413001570641034L;

    // 驱动ID,UUID
    private String id;

    // 第三方应用系统ID
    private String appId;

    // 第三方应用系统名称
    private String appName;

    // 映射名称
    private String name;

    // 是否启用该任务
    private boolean enable = true;

    // 同步状态（全量、增量）
    private String model = MappingConstant.SYNC_ALL;

    // 每次执行任务总数
    private Integer maxTask = 10000;

    // 每次批量执行数
    private Integer batchNum = 1000;

    // 线程数
    private Integer threadNum = 10;

    // 总进度
    private Integer process = 0;

    // 已完成进度
    private Integer processCompleted = 0;

    // 成功
    private Integer success = 0;

    // 失败
    private Integer fail = 0;

    // 同步时间（单位毫秒）
    private Long runTime;

    // 最近运行时间
    private Date startDate = new Date();

    // 最近运行时间字符串
    private String startDateStr;

    // 最近修改时间
    private Long updateTime = System.currentTimeMillis();
    
    // 是否在运行
    private boolean isRun = false;

    public Task() {
        super();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public Integer getBatchNum() {
        return batchNum;
    }

    public void setBatchNum(Integer batchNum) {
        this.batchNum = batchNum;
    }

    public Integer getThreadNum() {
        return threadNum;
    }

    public void setThreadNum(Integer threadNum) {
        this.threadNum = threadNum;
    }

    public Integer getMaxTask() {
        return maxTask;
    }

    public void setMaxTask(Integer maxTask) {
        this.maxTask = maxTask;
    }

    public Integer getProcess() {
        return process;
    }

    public void setProcess(Integer process) {
        this.process = process;
    }

    public Integer getProcessCompleted() {
        return processCompleted;
    }

    public void setProcessCompleted(Integer processCompleted) {
        this.processCompleted = processCompleted;
    }

    public Integer getSuccess() {
        return success;
    }

    public void setSuccess(Integer success) {
        this.success = success;
    }

    public Integer getFail() {
        return fail;
    }

    public void setFail(Integer fail) {
        this.fail = fail;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public String getStartDateStr() {
        return startDateStr;
    }

    public void setStartDateStr(String startDateStr) {
        this.startDateStr = startDateStr;
    }

    public Long getRunTime() {
        return runTime;
    }

    public void setRunTime(Long runTime) {
        this.runTime = runTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public boolean isRun() {
        return isRun;
    }

    public void setRun(boolean isRun) {
        this.isRun = isRun;
    }

}
